#include<iostream>
#include<queue>
#include<map>
#include<string>
#include<unordered_map>
using namespace std;
unordered_map<string, int>dis;
typedef pair<string, char> PSC;
string start, aim, s;
map<string, PSC>pre;
queue<string>q;
int dx[] = { 0,-1,0,1 };
int dy[] = { -1,0,1,0 };
int bfs(string start)
{
	dis[start] = 0;
	q.push(start);
	aim = "12345678x";
	while (q.size()) {
		string t = q.front();
		q.pop();
		int distance = dis[t];
		if (t == aim) {
			return distance;
		}
		int k = t.find("x");
		for (int i = 0; i < 4; i++) {
			int a = k / 3 + dx[i];
			int b = k % 3 + dy[i];
			if (a >= 0 && a < 3 && b >= 0 && b < 3) {
				string temp = t;
				swap(temp[a * 3 + b], temp[k]);
				if (!dis.count(temp)) {
					q.push(temp);
					dis[temp] = distance + 1;
					if (dx[i] == 0) {
						if (dy[i] == -1) {
							pre[temp] = { t,'l' };
						}
						else {
							pre[temp] = { t,'r' };
						}
					}
					else if (dx[i] == 1) {
						pre[temp] = { t,'d' };
					}
					else {
						pre[temp] = { t,'u' };
					}
				}
				//swap(temp[a * 3 + b], temp[k]);
			}
		}
	}
	return -1;
}
int main()
{
	getline(cin, s);
	for (int i = 0; i < s.size(); i += 2) {
		start += s[i];	
	}
	if (bfs(start) == -1) {
		cout << "unsolvable" << endl;
	}
	//cout << dis[aim] << endl;
	else {
		string temp = aim;
		string ans;
		while (temp != start) {
			ans+=pre[temp].second;
			temp = pre[temp].first;
		}
		for (int i = 0; i < ans.size(); i++) {
			cout << ans[i];
		}
		cout << endl;
	}
	return 0;
}